<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let params = {
            appkey:'heshun',
            id:111
        }
        // 参数=值&参数=值.......
        // appkey=laotang&id=111

        let arr = []
        // console.log(`${key}=${params[key]}`)  // appkey=laotang   id=111
        for(let key in params){
            arr.push(`${key}=${params[key]}`)
        }
        // console.log(arr) // ['appkey=laotang', 'id=111']
        console.log(arr.join('&'))// appkey=laotang&id=111
    </script>
</body>
</html>